/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-29 10:46:41
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-29 10:59:16
 */

import java.util.LinkedList;

public class Test05LinkedList {
    public static void main(String[] args){
        //实例化集合对象
        LinkedList<String> list = new LinkedList<String>();
        //往集合中存放对象
        list.add("1");
        list.add("2");
        list.add("3");
        System.out.println(list);
        list.addFirst("First");
        list.addLast("Last");
        System.out.println(list.getFirst());
        System.out.println(list.getLast());
        System.out.println(list);
        System.out.println(list.removeFirst());
        System.out.println(list.removeLast());
        System.out.println(list);
        System.out.println(list);
        list.push("pushElement");
        System.out.println(list);
        
    }
}